home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / powerd / modules.lha / modules / gadgets / listbrowser.m < prev    next >
Encoding:
Text File  |  2002-01-13  |  13.3 KB  |  329 lines

  1. /*****************************************************************************/
  2. MODULE 'intuition/gadgetclass'
  3. /*****************************************************************************/
  4. /* LBM_ADDNODE creates a listbrowser node and inserts it to the currently
  5.  * attached list. The number of columns is automatically set according to the
  6.  * object's column number. If the node would become visible, it is automatically
  7.  * rendered. This method returns the address of the new node. (V41)
  8.  */
  9. #define LBM_ADDNODE  ($580001)
  10.  
  11. OBJECT lbAddNode
  12.  MethodID:ULONG,                  /* LBM_ADDNODE */
  13.  GInfo:PTR TO GadgetInfo,     /* to provide rendering info */
  14.  Node:PTR TO Node,            /* Insert() after this node */
  15.  NodeAttrs:PTR TO TagItem     /* LBNA taglist */
  16.  
  17. /* LBM_REMNODE removes and frees the chosen node. If the node was visible, the
  18.  * display is updated. The method returns 1 if the operation was successful.
  19.  * (V41) */
  20. #define LBM_REMNODE  ($580002)
  21.  
  22. OBJECT lbRemNode
  23.  MethodID:ULONG,                 /* LBM_REMNODE */
  24.  GInfo:PTR TO GadgetInfo,    /* to provide rendering info */
  25.  Node:PTR TO Node            /* Remove() this node */
  26.  
  27. /* LBM_EDITNODE changes the chosen node's attributes and renders the
  28.  * changes. The method returns 1 if the operation was successful. (V41) */
  29. #define LBM_EDITNODE  ($580003)
  30.  
  31. OBJECT lbEditNode
  32.  MethodID:ULONG,                  /* LBM_EDITNODE */
  33.  GInfo:PTR TO GadgetInfo,     /* to provide rendering info */
  34.  Node:PTR TO Node,            /* modify this node */
  35.  NodeAttrs:PTR TO TagItem     /* according to this taglist */
  36.  
  37. /* LBM_SORT */
  38. #define LBM_SORT  ($580004)
  39.  
  40. OBJECT lbSort
  41.  MethodID:ULONG,                 /* LBM_SORT */
  42.  GInfo:PTR TO GadgetInfo,    /* to provide rendering info */
  43.  Column:ULONG,               /* Column to sort by */
  44.  Reverse:ULONG,              /* Reverse sort */
  45.  CompareHook:PTR TO Hook     /* Optional hook to compare items */
  46.  
  47. /* LBM_SHOWCHILDREN */
  48. #define LBM_SHOWCHILDREN  ($580005)
  49.  
  50. OBJECT lbShowChildren
  51.  MethodID:ULONG,                  /* LBM_SHOWCHILDREN */
  52.  GInfo:PTR TO GadgetInfo,    /* to provide rendering info */
  53.  Node:PTR TO Node,           /* Starting ParentNode, NULL means start at root. */
  54.  Depth:WORD                  /* Depth to Show */
  55.  
  56. /* LBM_HIDECHILDREN */
  57. #define LBM_HIDECHILDREN  ($580006)
  58.  
  59. OBJECT lbHideChildren
  60.  MethodID:ULONG,                  /* LBM_HIDECHILDREN */
  61.  GInfo:PTR TO GadgetInfo,    /* to provide rendering info */
  62.  Node:PTR TO Node,           /* Starting ParentNode, NULL means start at root. */
  63.  Depth:WORD                  /* Depth to Hide */
  64.  
  65. /*****************************************************************************/
  66. /* ListBrowser Node attributes.
  67.  */
  68. #define LBNA_Dummy  (TAG_USER+$5003500)
  69. #define LBNA_Selected  (LBNA_Dummy+1)
  70. /* (BOOL) If the node is to be selected.  Defaults to FALSE. */
  71. #define LBNA_Flags  (LBNA_Dummy+2)
  72. /* (ULONG) Flags for the node.  Defaults to 0. */
  73. #define LBNA_UserData  (LBNA_Dummy+3)
  74. /* (ULONG) User data.  Defaults to NULL. */
  75. #define LBNA_Column  (LBNA_Dummy+4)
  76. /* (WORD) Column in the node that the attributes below effect.   Defaults
  77.    * to 0.*/
  78. #define LBNCA_Text  (LBNA_Dummy+5)
  79. /* (STRPTR) Text to display in the column.  Defaults to NULL. */
  80. #define LBNCA_Integer  (LBNA_Dummy+6)
  81. /* (LONG *) Pointer to an integer to display in the column.  Defaults to NULL. */
  82. #define LBNCA_FGPen  (LBNA_Dummy+7)
  83. /* (WORD) Column foreground pen. */
  84. #define LBNCA_BGPen  (LBNA_Dummy+8)
  85. /* (WORD) Column background pen. */
  86. #define LBNCA_Image  (LBNA_Dummy+9)
  87. /* (struct Image *) Image to display in the column.  Defaults to NULL. */
  88. #define LBNCA_SelImage  (LBNA_Dummy+10)
  89. /* (struct Image *) Image to display in column when selected.  Defaults
  90.    * to NULL. */
  91. #define LBNCA_HorizJustify  (LBNA_Dummy+11)
  92. #define LBNCA_Justification  LBNCA_HorizJustify
  93. /* (ULONG) Column justification.  Defaults to LCJ_LEFT. */
  94. #define LBNA_Generation  (LBNA_Dummy+12)
  95. /* Node generation.  Defaults to 0. */
  96. #define LBNCA_Editable  (LBNA_Dummy+13)
  97. /* (BOOL) If this column is editable.  Requires LBNCA_CopyText. Defaults
  98.    * to FALSE. */
  99. #define LBNCA_MaxChars  (LBNA_Dummy+14)
  100. /* (WORD) Maximum characters in an editable entry.  Required when using
  101.    * LBNCA_Editable. */
  102. #define LBNCA_CopyText  (LBNA_Dummy+15)
  103. /* Copy the LBNCA_Text contents to an internal buffer. */
  104. #define LBNA_CheckBox  (LBNA_Dummy+16)
  105. /* (BOOL) this is a checkbox node */
  106. #define LBNA_Checked  (LBNA_Dummy+17)
  107. /* (BOOL) is checked if true */
  108. #define LBNA_NodeSize  (LBNA_Dummy+18)
  109. /* (ULONG) size of custom node and optimzie mempool puddles */
  110. #define LBNCA_EditTags  (LBNA_Dummy+19)
  111. /* (struct TagItem *) taglist sent to editable string */
  112. #define LBNCA_RenderHook  (LBNA_Dummy+20)
  113. /* (struct Hook *) effectivly the same as gadtools listview hook */
  114. #define LBNCA_HookHeight  (LBNA_Dummy+22)
  115. /* (WORD) height in pixels of the hook function rendering */
  116. #define LBNA_MemPool  (LBNA_Dummy+23)
  117. /* (APTR) exec memory pool to use */
  118. #define LBNA_NumColumns  (LBNA_Dummy+24)
  119. /* (WORD) for GetListBrowserNodeAttrs() only! */
  120. #define LBNA_Priority  (LBNA_Dummy+25)
  121. /* (UBYTE) Sets the exec node->ln_Pri */
  122. #define LBNCA_CopyInteger  (LBNA_Dummy+26)
  123. /* (BOOL) AllocListBrowserNodeAttrs() or SetListBrowserNodeAttrs() only! */
  124. #define LBNCA_WordWrap  (LBNA_Dummy+27)
  125. /* (BOOL) WordWrap this node's LBNCA_Text data */
  126. #define LBNCA_VertJustify  (LBNA_Dummy+28)
  127. /* (ULONG) Row justification.  Defaults to LRJ_BOTTOM. */
  128. #define LBCIA_MemPool    (LBNA_Dummy+50)
  129.     /* (APTR) (V45) MemPool for ColumnInfo */
  130. #define LBCIA_Column    (LBNA_Dummy+51)
  131. #define LBCIA_Title        (LBNA_Dummy+52)
  132. #define LBCIA_Weight    (LBNA_Dummy+53)
  133. #define LBCIA_Width        (LBNA_Dummy+54)
  134. #define LBCIA_Flags        (LBNA_Dummy+55)
  135.  
  136. /* Flags for the LBNA_Flags node attribute. */
  137. CONST LBFLG_READONLY=1,
  138.  LBFLG_CUSTOMPENS=2,
  139.  LBFLG_HASCHILDREN=4,
  140.  LBFLG_SHOWCHILDREN=8,
  141.  LBFLG_HIDDEN=16,
  142.  LCJ_LEFT=0,
  143.  LCJ_CENTER=1,
  144.  LCJ_RIGHT=2,
  145.  LCJ_CENTRE=LCJ_CENTER,
  146.  LRJ_BOTTOM=0,
  147.  LRJ_CENTER=1,
  148.  LRJ_TOP=2,
  149.  LRJ_CENTRE=LRJ_CENTER,
  150.  LB_DRAW=$202,
  151.  LBCB_OK=0,
  152.  LBCB_UNKNOWN=1,
  153.  LBR_NORMAL=0,
  154.  LBR_SELECTED=1
  155.  
  156. OBJECT LBDrawMsg
  157.  MethodID:ULONG,              /* LV_DRAW */
  158.  RastPort:PTR TO RastPort,    /* Where to render to */
  159.  DrawInfo:PTR TO DrawInfo,    /* Useful to have around */
  160.  Bounds:Rectangle,            /* Limits of where to render */
  161.  State:ULONG                  /* How to render */
  162.  
  163. /* Sort Hook Data Structure. */
  164. OBJECT LBSortMsg
  165.   TypeA:ULONG,
  166.   [CUNION
  167.     Integer:LONG,
  168.     Text:PTR TO UBYTE
  169.   ENDUNION]:lbsm_DataA,
  170.   UserDataA:APTR,
  171.   TypeB:ULONG,
  172.   [CUNION
  173.     Integer:LONG,
  174.     Text:PTR TO UBYTE
  175.   ENDUNION]:lbsm_DataB,
  176.   UserDataB:APTR
  177.  
  178. /* Information for columns of the list browser. */
  179. OBJECT ColumnInfo
  180.  Width:WORD,
  181.  Title:PTR TO UBYTE,
  182.  Flags:ULONG
  183.  
  184. /* Possible ColumnInfo Flags */
  185. #define CIF_WEIGHTED  0   /* weighted width column */
  186. #define CIF_FIXED  1    /* fixed pixel width column */
  187. #define CIF_DRAGGABLE  2
  188. #define CIF_NOSEPARATORS  4
  189. #define CIF_SORTABLE  8
  190. /* Additional attributes defined by the List Browser class
  191.  */
  192. #define LISTBROWSER_Dummy      (REACTION_Dummy+$0003000)
  193. #define LISTBROWSER_Top        (LISTBROWSER_Dummy+1)
  194. /* (LONG) Top position node. Defauts to 0. */
  195. #define LISTBROWSER_Reserved1    (LISTBROWSER_Dummy+2)
  196. /* RESERVED */
  197. #define LISTBROWSER_Labels       (LISTBROWSER_Dummy+3)
  198. /* (struct List *) Defaults to ~0. */
  199. #define LISTBROWSER_Selected     (LISTBROWSER_Dummy+4)
  200. /* (LONG) numeric index of node currently selected; Defaults to -1. */
  201. #define LISTBROWSER_SelectedNode   (LISTBROWSER_Dummy+5)
  202. /* (struct Node *) node currently seleted */
  203. #define LISTBROWSER_MultiSelect    (LISTBROWSER_Dummy+6)
  204. /* (BOOL) Defaults to FALSE. */
  205. #define LISTBROWSER_VertSeparators   (LISTBROWSER_Dummy+7)
  206. #define LISTBROWSER_Separators     LISTBROWSER_VertSeparators
  207. /* (BOOL) Render column separators. Defaults to TRUE. */
  208. #define LISTBROWSER_ColumnInfo     (LISTBROWSER_Dummy+8)
  209. /* (struct ColumnInfo *) Defaults to NULL. */
  210. #define LISTBROWSER_MakeVisible    (LISTBROWSER_Dummy+9)
  211. /* (LONG) Defaults to 0. */
  212. #define LISTBROWSER_VirtualWidth   (LISTBROWSER_Dummy+10)
  213. /* (WORD) Defaults to 0. */
  214. #define LISTBROWSER_Borderless     (LISTBROWSER_Dummy+11)
  215. /* (BOOL) Defaults to FALSE. */
  216. #define LISTBROWSER_VerticalProp   (LISTBROWSER_Dummy+12)
  217. /* (BOOL) Defaults to TRUE. */
  218. #define LISTBROWSER_HorizontalProp   (LISTBROWSER_Dummy+13)
  219. /* (BOOL) Defaults to FALSE. */
  220. #define LISTBROWSER_Left       (LISTBROWSER_Dummy+14)
  221. /* (WORD) Defaults to 0. */
  222. #define LISTBROWSER_Reserved2    (LISTBROWSER_Dummy+15)
  223. /* RESERVED */
  224. #define LISTBROWSER_AutoFit      (LISTBROWSER_Dummy+16)
  225. /* (BOOL) Defaults to FALSE. */
  226. #define LISTBROWSER_ColumnTitles   (LISTBROWSER_Dummy+17)
  227. /* (BOOL) Defaults to FALSE. */
  228. #define LISTBROWSER_ShowSelected   (LISTBROWSER_Dummy+18)
  229. /* (BOOL) Defaults to FALSE. */
  230. #define LISTBROWSER_VPropTotal     (LISTBROWSER_Dummy+19)
  231. #define LISTBROWSER_VPropTop     (LISTBROWSER_Dummy+20)
  232. #define LISTBROWSER_VPropVisible   (LISTBROWSER_Dummy+21)
  233. /* State of the vertical prop gadget (if any). */
  234. #define LISTBROWSER_HPropTotal     (LISTBROWSER_Dummy+22)
  235. #define LISTBROWSER_HPropTop     (LISTBROWSER_Dummy+23)
  236. #define LISTBROWSER_HPropVisible   (LISTBROWSER_Dummy+24)
  237. /* State of the horizontal prop gadget (if any). */
  238. #define LISTBROWSER_MouseX       (LISTBROWSER_Dummy+25)
  239. #define LISTBROWSER_MouseY       (LISTBROWSER_Dummy+26)
  240. /* (WORD) Returns position of mouse release. */
  241. #define LISTBROWSER_Hierarchical   (LISTBROWSER_Dummy+27)
  242. /* (BOOL) Enables ListTree mode. Defaults to FALSE. */
  243. #define LISTBROWSER_ShowImage    (LISTBROWSER_Dummy+28)
  244. /* (struct Image *) ListTree expanded branchh custom image. Defaults to NULL. */
  245. #define LISTBROWSER_HideImage    (LISTBROWSER_Dummy+29)
  246. /* (struct Image *) ListTree colapsed branch custom image. Defaults to NULL. */
  247. #define LISTBROWSER_LeafImage    (LISTBROWSER_Dummy+30)
  248. /* (struct Image *) ListTree branch item custom image. Defaults to NULL. */
  249. #define LISTBROWSER_ScrollRaster   (LISTBROWSER_Dummy+31)
  250. /* (BOOL) See autodocs for Intuition V37 bug.  Defaults to TRUE. */
  251. #define LISTBROWSER_Spacing      (LISTBROWSER_Dummy+32)
  252. /* (WORD) Defaults to 0. */
  253. #define LISTBROWSER_Editable     (LISTBROWSER_Dummy+33)
  254. /* (WORD) Defaults to FALSE. */
  255. #define LISTBROWSER_EditNode     (LISTBROWSER_Dummy+35)
  256. /* (LONG) Specify a node to edit. */
  257. #define LISTBROWSER_EditColumn     (LISTBROWSER_Dummy+36)
  258. /* (WORD) Specify a column to edit */
  259. #define LISTBROWSER_EditTags     (LISTBROWSER_Dummy+39)
  260. /* (struct TagItem *) Taglist passed to editible node string gadget.
  261.      Defaults to NULL. */
  262. #define LISTBROWSER_Position     (LISTBROWSER_Dummy+34)
  263. /* (ULONG) See possible values below. */
  264. #define LISTBROWSER_RelEvent     (LISTBROWSER_Dummy+37)
  265. /* (ULONG) See possible values below. */
  266. #define LISTBROWSER_NumSelected    (LISTBROWSER_Dummy+38)
  267. /* (LONG) Number of selected nodes. */
  268. #define LISTBROWSER_RelColumn    (LISTBROWSER_Dummy+40)
  269. /* (WORD) Column number clicked on. */
  270. #define LISTBROWSER_HorizSeparators  (LISTBROWSER_Dummy+41)
  271. /* (BOOL) Show horizontal node separators */
  272. #define LISTBROWSER_CheckImage     (LISTBROWSER_Dummy+42)
  273. /* (struct Image *) Custom checkbox image, Checked state. */
  274. #define LISTBROWSER_UncheckedImage   (LISTBROWSER_Dummy+43)
  275. /* (struct Image *) Custom checkbox image, UnChecked state. */
  276. #define LISTBROWSER_TotalNodes     (LISTBROWSER_Dummy+44)
  277. /* (LONG) Total node count. */
  278. #define LISTBROWSER_MinNodeSize    (LISTBROWSER_Dummy+45)
  279. /* (LONG) Minimum Node size for custom MemPool custom node optimization */
  280. #define LISTBROWSER_TitleClickable   (LISTBROWSER_Dummy+46)
  281. /* (BOOL) Allow column-title bar clicking. */
  282. #define LISTBROWSER_MinVisible     (LISTBROWSER_Dummy+47)
  283. /* (LONG) Minimum visible node count. This is a causes the
  284.    * minimum domain to be large enough to hold the specified number of
  285.    * nodes using the the estimated average node height. Note, ESTIMATED,
  286.    * this is not garanteed results. The result may be slightly more or
  287.    * less than specified, and potentially alot greater if other objects
  288.    * within the layout group cause the listbrowser to layout larger
  289.    * than its minimum domain.
  290.    */
  291. #define LISTBROWSER_Reserved6    (LISTBROWSER_Dummy+48)
  292. /* RESERVED */
  293. #define LISTBROWSER_Reserved7    (LISTBROWSER_Dummy+49)
  294. /* RESERVED */
  295. #define LISTBROWSER_PersistSelect  (LISTBROWSER_Dummy+50)
  296. /* (LONG) When set TRUE, SHIFT key is NOT required for multi-select. */
  297. #define LISTBROWSER_CursorSelect   (LISTBROWSER_Dummy+51)
  298. /* (LONG) Keyboard Cursor Selected Node Number */
  299. #define LISTBROWSER_CursorNode     (LISTBROWSER_Dummy+52)
  300. /* (struct Node *) Keyboard Cursor Selected Node */
  301. #define LISTBROWSER_FastRender     (LISTBROWSER_Dummy+53)
  302. /* (BOOL) Causes use of mask planes, and turns off custom pen support */
  303. /* The improvement with deep ECS or AGA display is *HUGE*. */
  304. #define LISTBROWSER_TotalVisibleNodes  (LISTBROWSER_Dummy+54)
  305. /* (LONG) Total visible node count. */
  306. #define LISTBROWSER_WrapText   (LISTBROWSER_Dummy+55)
  307. /* (BOOL) Enable word wrap of text nodes */
  308. /* Possible values for LISTBROWSER_Position. */
  309. #define LBP_LINEUP  1
  310. #define LBP_LINEDOWN  2
  311. #define LBP_PAGEUP  3
  312. #define LBP_PAGEDOWN  4
  313. #define LBP_TOP  5
  314. #define LBP_BOTTOM  6
  315. #define LBP_SHIFTLEFT  10
  316. #define LBP_SHIFTRIGHT  11
  317. #define LBP_LEFTEDGE  12
  318. #define LBP_RIGHTEDGE  13
  319. /* Possible values for LISTBROWSER_RelEvent. */
  320. #define LBRE_NORMAL  1
  321. #define LBRE_HIDECHILDREN  2
  322. #define LBRE_SHOWCHILDREN  4
  323. #define LBRE_EDIT  8
  324. #define LBRE_DOUBLECLICK  16
  325. #define LBRE_CHECKED  32
  326. #define LBRE_UNCHECKED  64
  327. #define LBRE_TITLECLICK  128
  328. #define LBRE_COLUMNADJUST  256
  329.